import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 班级信息
 */
@Entity('class_info')
export class ClassInfoEntity extends BaseEntity {
  @Column({ comment: '班级名称', length: 100 })
  className: string;

  @Column({ comment: '上课时间', type: 'datetime', nullable: true })
  startTime: Date;

  @Column({ comment: '下课时间', type: 'datetime', nullable: true })
  endTime: Date;

  @Column({ comment: '人员限额', default: 0 })
  limitCount: number;

  @Column({ comment: '当前人数', default: 0 })
  currentCount: number;

  @Column({ comment: '状态', dict: ['关闭', '开启', '结课'], default: 0 })
  status: number;

  @Index()
  @Column({ comment: '店铺ID', nullable: true })
  shopId: number;

  @Index()
  @Column({ comment: '医生ID', nullable: true })
  doctorId: number;
}
